package cn.zurish.cloud.kafka.mq;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

//@RestController
public class KafkaController {

    private KafkaTemplate<String, String> kafkaTemplate;

    @PostMapping("/sendMessage")
    public void sendMessage(@RequestParam(value = "message") String message) {
        kafkaTemplate.send("quickstart-events", message);
    }

}